Test a Perceptual Phenomenon

Background Information

In a Stroop task, participants are presented with a list of words, with each word displayed in a color of ink. The participant’s task is to say out loud the color of the ink in which the word is printed. The task has two conditions: a congruent words condition, and an incongruent words condition. In the congruent words condition, the words being displayed are color words whose names match the colors in which they are printed: for example RED,BLUE. In the incongruent words condition, the words displayed are color words whose names do not match the colors in which they are printed: for example PURPLE, ORANGE. In each case, we measure the time it takes to name the ink colors in equally-sized lists. Each participant will go through and record a time from each condition.

Questions for Investigation

1. What is our independent variable? What is our dependent variable?

The independent variable here are the two conditions specified for the task, i.e. the congruent words condition and the incongruent words conditions. The dependent variable here is the time it takes for each participant to name the ink color in each list.

2. What is an appropriate set of hypotheses for this task? What kind of statistical test do you expect to perform? Justify your choices.

$H_{0}$ (null hypothesis) - The null hypothesis is that there is no difference in the average time it takes to name the ink color, between the congruent and incongruent word condition. Which in other words also means that it takes the same amount of time on average to say words which have matching color, as the words whose color doesn't match.

$H_{a}$ (alternative Hypothesis) - There is a difference in the average time it takes to name the ink color between the congruent and incongruent word condition.

$\mu_{c}$: population mean of congruent words
$\mu_{i}$: population mean of incongruent words

Mathematically, this can be expressed as:

\begin{equation} H_0: \mu_c - \mu_i = 0 \end{equation} \begin{equation} H_a:\mu_c - \mu_i \neq 0 \end{equation}

We will perform a two-tailed dependent t-test.

We will use the t-test as opposed to the z test, because we do not know the standard deviation of the population and the sample size is 24, which is < 30.

Reasons for performing two-tailed t-test is to test if the two means are significantly different from each other. It is expected that the mean for the incongruent condition should be higher. But this assumption could be incorrect. Hence as we have specified in our alternate hypothesis we will check for both increase or decrease. We will use the dependent t-test because we are testing repeatedly for the same set of participants under different conditions.

3. Report some descriptive statistics regarding this dataset. Include at least one measure of central tendency and at least one measure of variability.

In [3]:
import pandas as pd
In [4]:
ds = pd.read_csv("stroopdata.csv")

Let's take a look at the basic statistics for each group

In [5]:
ds.describe()
Out[5]:
Congruent Incongruent
count 24.000000 24.000000
mean 14.051125 22.015917
std 3.559358 4.797057
min 8.630000 15.687000
25% 11.895250 18.716750
50% 14.356500 21.017500
75% 16.200750 24.051500
max 22.328000 35.255000

As we can see for the congruent group sample mean = 14.05 and std deviation = 3.55. For the incongruent group, sample mean = 22.01 and std dev = 4.79.

4. Provide one or two visualizations that show the distribution of the sample data. Write one or two sentences noting what you observe about the plot or plots.

In [6]:
import matplotlib.pyplot as plt
%matplotlib inline
In [7]:
ax = ds.plot.box()
ax.set_title('Boxplot of Reaction Time for the two conditions')
ax.set_ylabel("Time in seconds")
Out[7]:
Text(0,0.5,u'Time in seconds')

As we can see from the boxplot above, the mean reaction time as well as the IQR are longer for Incongruent condition compared to congruent condition which is as expected from the statistics.

5. Now, perform the statistical test and report your results. What is your confidence level and your critical statistic value? Do you reject the null hypothesis or fail to reject it? Come to a conclusion in terms of the experiment task. Did the results match up with your expectations?

N = 24

Degrees of freedom (df) = 23

Hence from the t-table, the critical value for t with $\alpha$ = 0.05,

$t_{critical}$ = $\pm$2.069

S = 4.86 (std dev for the difference)

Hence the SE (standard error):

SE = 4.86/sqrt(24) = 0.99

$\mu_{c}$ - $\mu_{i}$ = 14.05-22.01 = -7.96

The t statistic (t) for this mean is:

t = -7.96/0.99 = -8.04 which indicates a p value < 0.0001

As Tstatistic < Tcritical at alpha = 0.05 which is within the critical region, we reject the null.

Now the margin of error (ME) for 95% Confidence Interval i.e with $\alpha$ = 0.05 can be calculated as:

ME = $t_{critical}$ * SE = 2.069 * 0.99 = 2.04

Hence the 95% confidence interval for average difference in time for congruent and incongruent conditions is {-10.00,-5.91}

This indicates that the participants react in significantly less time for the congruent condition as compared to the incongruent condition. Based on the sample values provided, this is as expected.

6. Optional: What do you think is responsible for the effects observed? Can you think of an alternative or similar task that would result in a similar effect? Some research about the problem will be helpful for thinking about these two questions!

The brain apparently processes words faster than it processes colors, and hence in the incongruent condition, there is an extra lag in identifying the color when the text name also reads as a color which causes an interference.

As found from the wiki page there are many similar variations of the Stroop test like Reverse Stroop test or Numerical Stroop test which result in a similar effect.